<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">


    <title>生态瞬时测试</title>
    <meta name="keywords" content="">
    <meta name="description" content="">

    <link rel="shortcut icon" href="favicon.ico">
    <link href="../css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="../css/font-awesome.css?v=4.4.0" rel="stylesheet">
    <link href="../css/plugins/iCheck/custom.css" rel="stylesheet">
    <link href="../css/animate.css" rel="stylesheet">
    <link href="../css/style.css?v=4.1.0" rel="stylesheet">
    <link rel="stylesheet" href="../css/paging.css">

</head>

<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">

    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>策略详情</h5>
                </div>
                <div class="ibox-content">
                    <div class="row">
                        <div class="col-sm-5 m-b-xs">
                        </div>
                        <div class="col-sm-4 m-b-xs">
                        </div>
                        <div class="col-sm-3">
                            <!--<a href="add-test.html" class="btn btn-sm btn-primary">添加实验</a>-->
                        </div>
                    </div>
                    <div class="table-responsive">
                        <table class="table table-bordered table-striped">
                            <thead>
                            <tr>
                                <th>时间</th><th>状态</th>
                            </tr>
                            </thead>
                            <tbody id="test-box">
                            <!--表格加载内容显示-->
                            </tbody>
                        </table>
                    </div>
                    <div class="paging">
                        <div id="paging" class="page_div"></div>
                    </div>
                </div>

            </div>

        </div>

    </div>
</div>

<!-- 全局js -->

<script src="../js/jquery.min.js?v=2.1.4"></script>
<script src="../js/bootstrap.min.js?v=3.3.6"></script>
<script src="../js/paging.js"></script>
<script src="../js/dateChange.js"></script>
<script src="../js/global.js"></script>
<!-- iCheck -->
<script src="../js/plugins/iCheck/icheck.min.js"></script>
<script>
    $(document).ready(function () {
        $('.i-checks').iCheck({
            checkboxClass: 'icheckbox_square-green',
            radioClass: 'iradio_square-green',
        });
    });
</script>
<script>
    $(document).ready(function () {
        function format(t){
            var dt = new Date(t);
            var str = dt.getFullYear();
            str += "-" + dt.getMonth() + 1 + "-" + dt.getDate();
            str += " " + dt.getHours() + ":" +dt.getMinutes() + ":" + dt.getSeconds();
            return str;
        }
        var userId = location.search.split("=")[1];
        var testId = sessionStorage.getItem("testId");
        var token = sessionStorage.getItem("token");
        var geturl = "http://123.206.18.189:8080/experiments/"+ testId +"/experiment_subjects/"+ userId +"/answer_time_list";
        $.ajax({
            type:"GET",
            url:geturl,
            headers:{
                authToken:token
            },
            success:function(res){
                var html = "";
                for(let i = 0; i < res.length; i++) {
                    html += "<tr>";
                    html += "<td>"+ format(res[i].answerTime) +"</td>";
                    html += "<td>"+ res[i].notification +"</td>";
                    html += "</tr>";
                }

                $("#test-box").html(html);
            }
        });

    })
</script>

</body>

</html>
